<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="技术博客">
    
    <meta name="author" content="jiesun">
    <!-- preconnect -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    
    
    <!--- Seo Part-->
    
    <link rel="canonical" href="https://anca.gitee.io/2023/07/06/vue3-3/"/>
    <meta name="robots" content="index,follow">
    <meta name="googlebot" content="index,follow">
    <meta name="revisit-after" content="1 days">
    
        <meta name="description" content="Vue 模版渲染 -&gt; AST（抽象语法树）转化为渲染函数">
<meta property="og:type" content="article">
<meta property="og:title" content="vue3 源码分析（3）- 渲染函数">
<meta property="og:url" content="https://anca.gitee.io/2023/07/06/vue3-3/index.html">
<meta property="og:site_name" content="孙杰的博客">
<meta property="og:description" content="Vue 模版渲染 -&gt; AST（抽象语法树）转化为渲染函数">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://anca.gitee.io/jiesun.gitee.io/images/vue3-3/parseChildren.jpg">
<meta property="og:image" content="https://anca.gitee.io/jiesun.gitee.io/images/vue3-3/parseChildren.jpg">
<meta property="og:image" content="https://anca.gitee.io/jiesun.gitee.io/images/vue3-3/parseChildren.jpg">
<meta property="og:image" content="https://anca.gitee.io/jiesun.gitee.io/images/vue3-3/hoist.jpg">
<meta property="og:image" content="https://anca.gitee.io/jiesun.gitee.io/images/vue3-3/result.jpg">
<meta property="article:published_time" content="2023-07-06T07:25:03.892Z">
<meta property="article:modified_time" content="2023-11-10T01:56:25.094Z">
<meta property="article:author" content="jiesun">
<meta property="article:tag" content="源码系列">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://anca.gitee.io/jiesun.gitee.io/images/vue3-3/parseChildren.jpg">
    
    
    <!--- Icon Part-->
    <link rel="icon" type="image/png" href="/jiesun.gitee.io/images/redefine-favicon.svg" sizes="192x192">
    <link rel="apple-touch-icon" sizes="180x180" href="/jiesun.gitee.io/images/redefine-favicon.svg">
    <meta name="theme-color" content="#A31F34">
    <link rel="shortcut icon" href="/jiesun.gitee.io/images/redefine-favicon.svg">
    <!--- Page Info-->
    
    <title>
        
            vue3 源码分析（3）- 渲染函数 -
        
        极乐净土
    </title>
    
<link rel="stylesheet" href="/jiesun.gitee.io/css/style.css">


    
        
<link rel="stylesheet" href="/jiesun.gitee.io/css/build/styles.css">

    

    
<link rel="stylesheet" href="/jiesun.gitee.io/fonts/fonts.css">

    
<link rel="stylesheet" href="/jiesun.gitee.io/fonts/Satoshi/satoshi.css">

    
<link rel="stylesheet" href="/jiesun.gitee.io/fonts/Chillax/chillax.css">

    <!--- Font Part-->
    
    
    
    

    <!--- Inject Part-->
    
    <script id="hexo-configurations">
    let Global = window.Global || {};
    Global.hexo_config = {"hostname":"anca.gitee.io","root":"/jiesun.gitee.io/","language":"zh-CN"};
    Global.theme_config = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":3,"number":false,"expand":true,"init_open":true},"copyright":true,"lazyload":true,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/wallhaven-wqery6-light.webp","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-wqery6-light.webp","dark":"/images/wallhaven-wqery6-dark.webp"},"title":"极乐净土","subtitle":{"text":[],"hitokoto":{"enable":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":false,"links":{"github":null,"instagram":null,"zhihu":null,"twitter":null,"email":null},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":true,"type":"fixed","audios":[{"name":"起风了","artist":"买辣椒也用券","url":"https://music.163.com/song/media/outer/url?id=1330348068.mp3","cover":"https://p2.music.126.net/diGAyEmpymX8G7JcnElncQ==/109951163699673355.jpg?param=130y130"},{"name":"盗墓笔记·十年人间","artist":"青肆ToriDo","url":"https://music.163.com/song/media/outer/url?id=1298484254.mp3","cover":"https://p2.music.126.net/4vY0tPpnINMLzjV8UKywIg==/109951163438805808.jpg?param=130y130"},{"name":"囍","artist":"葛东琪","url":"https://music.163.com/song/media/outer/url?id=1303289043.mp3","cover":"https://p2.music.126.net/H3Q3SeMVtuHvHY2uyaQdOw==/109951163472855051.jpg?param=130y130"}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.4.4","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Memos":{"path":"/essay","icon":"fa-regular fa-lightbulb"},"Archives":{"icon":"fa-regular fa-archive","submenus":{"Archives":"/archives","Categories":"/categories","Tags":"/tags"}}},"search":{"enable":false,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"links":null},"article_date_format":"auto","categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
    Global.language_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
    Global.data_config = {"masonry":false};
  </script>
    
    <!--- Fontawesome Part-->
    
<link rel="stylesheet" href="/jiesun.gitee.io/fontawesome/fontawesome.min.css">

    
<link rel="stylesheet" href="/jiesun.gitee.io/fontawesome/brands.min.css">

    
<link rel="stylesheet" href="/jiesun.gitee.io/fontawesome/solid.min.css">

    
<link rel="stylesheet" href="/jiesun.gitee.io/fontawesome/regular.min.css">

    
    
    
    
<meta name="generator" content="Hexo 6.3.0"></head>


<body>
<div class="progress-bar-container">
    

    
        <span class="pjax-progress-bar"></span>
        <span class="swup-progress-icon">
            <i class="fa-solid fa-circle-notch fa-spin"></i>
        </span>
    
</div>


<main class="page-container" id="swup">

    

    <div class="main-content-container">


        <div class="main-content-header">
            <header class="navbar-container">
    
    <div class="navbar-content">
        <div class="left">
            
            <a class="logo-title" href="https://anca.gitee.io/">
                
                极乐净土
                
            </a>
        </div>

        <div class="right">
            <!-- PC -->
            <div class="desktop">
                <ul class="navbar-list">
                    
                        
                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class="" 
                                    href="/jiesun.gitee.io/"  >
                                    
                                        
                                            <i class="fa-regular fa-house"></i>
                                        
                                        首页
                                    
                                </a>
                                <!-- Submenu -->
                                
                            </li>
                    
                        
                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class="" 
                                    href="/jiesun.gitee.io/essay"  >
                                    
                                        
                                            <i class="fa-regular fa-lightbulb"></i>
                                        
                                        MEMOS
                                    
                                </a>
                                <!-- Submenu -->
                                
                            </li>
                    
                        
                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class="has-dropdown" 
                                    href="#" onClick="return false;">
                                    
                                        
                                            <i class="fa-regular fa-archive"></i>
                                        
                                        归档&nbsp;<i class="fa-solid fa-chevron-down"></i>
                                    
                                </a>
                                <!-- Submenu -->
                                
                                    <ul class="sub-menu">
                                    
                                        <li>
                                        <a href="/jiesun.gitee.io/archives">归档
                                        </a>
                                        </li>
                                    
                                        <li>
                                        <a href="/jiesun.gitee.io/categories">分类
                                        </a>
                                        </li>
                                    
                                        <li>
                                        <a href="/jiesun.gitee.io/tags">标签
                                        </a>
                                        </li>
                                    
                                    </ul>
                                
                            </li>
                    
                    
                </ul>
            </div>
            <!-- Mobile -->
            <div class="mobile">
                
                <div class="icon-item navbar-bar">
                    <div class="navbar-bar-middle"></div>
                </div>
            </div>
        </div>
    </div>

    <!-- Mobile drawer -->
    <div class="navbar-drawer w-full absolute top-0 left-0 bg-background-color">
        <ul class="drawer-navbar-list flex flex-col justify-start items-center">
            
                
                    <li class="drawer-navbar-item text-base my-1.5 flex justify-center items-center">
                        <a class="rounded-3xl py-1.5 px-5 hover:border hover:!text-primary active:!text-primary group " 
                        href="/jiesun.gitee.io/"  >
                             
                                
                                    <i class="fa-regular fa-house"></i>
                                
                                首页
                            
                        </a>
                    </li>
                    <!-- Submenu -->
                    
            
                
                    <li class="drawer-navbar-item text-base my-1.5 flex justify-center items-center">
                        <a class="rounded-3xl py-1.5 px-5 hover:border hover:!text-primary active:!text-primary group " 
                        href="/jiesun.gitee.io/essay"  >
                             
                                
                                    <i class="fa-regular fa-lightbulb"></i>
                                
                                MEMOS
                            
                        </a>
                    </li>
                    <!-- Submenu -->
                    
            
                
                    <li class="drawer-navbar-item text-base my-1.5 flex justify-center items-center">
                        <a class="rounded-3xl py-1.5 px-5 hover:border hover:!text-primary active:!text-primary group has-dropdown" 
                        href="#" onClick="return false;">
                            
                                
                                    <i class="fa-regular fa-archive"></i>
                                
                                归档&nbsp;<i class="group-hover:rotate-180 transition-transform fa-solid fa-chevron-down"></i>
                            
                        </a>
                    </li>
                    <!-- Submenu -->
                              
                        
                            <li class="text-base flex justify-center items-center hover:underline active:underline hover:underline-offset-1 rounded-3xl">
                                <a class="py-0.5" href="/jiesun.gitee.io/archives">归档</a>
                            </li>
                        
                            <li class="text-base flex justify-center items-center hover:underline active:underline hover:underline-offset-1 rounded-3xl">
                                <a class="py-0.5" href="/jiesun.gitee.io/categories">分类</a>
                            </li>
                        
                            <li class="text-base flex justify-center items-center hover:underline active:underline hover:underline-offset-1 rounded-3xl">
                                <a class="py-0.5" href="/jiesun.gitee.io/tags">标签</a>
                            </li>
                        
                    
            

        </ul>
    </div>

    <div class="window-mask"></div>

</header>


        </div>

        <div class="main-content-body">

            

            <div class="main-content">

                
                    <div class="post-page-container">
    <div class="article-content-container">

        <div class="article-title">
            
                
                
                <img src="https://anca.gitee.io/jiesun.gitee.io/images/bg1.jpeg" alt="vue3 源码分析（3）- 渲染函数" class="max-w-none"/>
                
                <h1 class="article-title-cover">vue3 源码分析（3）- 渲染函数</h1>
            
            </div>
            
                    
        
        
            <div class="article-header">
                <div class="avatar">
                    <img src="/jiesun.gitee.io/images/redefine-avatar.svg">
                </div>
                <div class="info">
                    <div class="author">
                        <span class="name">jiesun</span>
                        
                            <span class="author-label">Lv3</span>
                        
                    </div>
                    <div class="meta-info">
                        <div class="article-meta-info">
    <span class="article-date article-meta-item">
        <i class="fa-regular fa-pen-fancy"></i>&nbsp;
        <span class="desktop">2023-07-06 15:25:03</span>
        <span class="mobile">2023-07-06 15:25:03</span>
        <span class="hover-info">创建</span>
    </span>
    
        <span class="article-date article-meta-item">
            <i class="fa-regular fa-wrench"></i>&nbsp;
            <span class="desktop">2023-11-10 09:56:25</span>
            <span class="mobile">2023-11-10 09:56:25</span>
            <span class="hover-info">更新</span>
        </span>
    

    
        <span class="article-categories article-meta-item">
            <i class="fa-regular fa-folders"></i>&nbsp;
            <ul>
                
                
                    
                        
                        <li>
                            <a href="/jiesun.gitee.io/categories/vue3-%E6%BA%90%E7%A0%81/">vue3 源码</a>&nbsp;
                        </li>
                    
                    
                
            </ul>
        </span>
    
    
        <span class="article-tags article-meta-item">
            <i class="fa-regular fa-tags"></i>&nbsp;
            <ul>
                
                    <li>
                        <a href="/jiesun.gitee.io/tags/%E6%BA%90%E7%A0%81%E7%B3%BB%E5%88%97/">源码系列</a>&nbsp;
                    </li>
                
            </ul>
        </span>
    

    
    
    
    
        <span class="article-pv article-meta-item">
            <i class="fa-regular fa-eye"></i>&nbsp;<span id="busuanzi_value_page_pv"></span>
        </span>
    
</div>

                    </div>
                </div>
            </div>
        

        


        <div class="article-content markdown-body">
            <h3 id="大致过程"><a href="#大致过程" class="headerlink" title="大致过程"></a>大致过程</h3><p>首先，compile 方法会通过 baseCompile 函数将模板字符串编译为 AST（抽象语法树），这一步骤主要是调用浏览器内置的解析器解析模板。</p>
<p>接下来，编译器会根据 AST 进行优化处理，包括静态节点提升、静态属性提升、事件侦听器缓存等。这一步骤主要是调用 optimize 函数。</p>
<p>然后，编译器会将优化后的 AST 生成渲染函数所需要的代码，这一步骤主要是调用 generate 函数生成渲染函数代码。</p>
<p>最后，编译器会封装生成的渲染函数、静态节点等信息，返回最终的编译结果对象。</p>
<h3 id="AST（抽象语法树）"><a href="#AST（抽象语法树）" class="headerlink" title="AST（抽象语法树）"></a>AST（抽象语法树）</h3><p>在 baseParse 将template转成ast 抽象语法树</p>
<blockquote>
<p>开始前template的样子<br><img  
                     lazyload
                     src="/images/loading.svg"
                     data-src="https://anca.gitee.io/jiesun.gitee.io/images/vue3-3/parseChildren.jpg"
                     
                ><br>转的结果<br><img  
                     lazyload
                     src="/images/loading.svg"
                     data-src="https://anca.gitee.io/jiesun.gitee.io/images/vue3-3/parseChildren.jpg"
                     
                ></p>
</blockquote>
<p>在compiler-core中的parse方法中parseChildren 循环处理 template<br><img  
                     lazyload
                     src="/images/loading.svg"
                     data-src="https://anca.gitee.io/jiesun.gitee.io/images/vue3-3/parseChildren.jpg"
                     
                ></p>
<h3 id="静态提升"><a href="#静态提升" class="headerlink" title="静态提升"></a>静态提升</h3><p>静态提升是Vue3编译优化中的其中一个优化点。所谓的静态提升，就是指在编译器编译的过程中，将一些静态的节点或属性提升到渲染函数之外。类似于<br>baseCompile方法中调用transform 方法<br>将ast 丰满起来 (codegenNode )</p>
<div class="highlight-container" data-rel="Tsx"><figure class="iseeu highlight tsx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> (options.<span class="property">hoistStatic</span>) &#123;</span><br><span class="line">  <span class="title function_">hoistStatic</span>(root, context)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></div>
<p><code>&lt;p&gt;static text&lt;/p&gt;</code> 会被提出去，不用每次都去重新渲染</p>
<p><img  
                     lazyload
                     src="/images/loading.svg"
                     data-src="https://anca.gitee.io/jiesun.gitee.io/images/vue3-3/hoist.jpg"
                     
                ></p>
<h3 id="翻译成渲染函数"><a href="#翻译成渲染函数" class="headerlink" title="翻译成渲染函数"></a>翻译成渲染函数</h3><p>通过其中 genFunctionPreamble 在context 的code 参数 从ast 编译成 code, 同时在这里将hoist 翻译成字符串</p>
<div class="highlight-container" data-rel="Tsx"><figure class="iseeu highlight tsx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">function</span> <span class="title function_">genFunctionPreamble</span>(<span class="params">ast: RootNode, context: CodegenContext</span>) &#123;</span><br><span class="line">  <span class="keyword">const</span> &#123;</span><br><span class="line">    ssr,</span><br><span class="line">    prefixIdentifiers,</span><br><span class="line">    push,</span><br><span class="line">    newline,</span><br><span class="line">    runtimeModuleName,</span><br><span class="line">    runtimeGlobalName,</span><br><span class="line">    ssrRuntimeModuleName</span><br><span class="line">  &#125; = context</span><br><span class="line">  <span class="keyword">const</span> <span class="title class_">VueBinding</span> =</span><br><span class="line">    !__BROWSER__ &amp;&amp; ssr</span><br><span class="line">      ? <span class="string">`require(<span class="subst">$&#123;<span class="built_in">JSON</span>.stringify(runtimeModuleName)&#125;</span>)`</span></span><br><span class="line">      : runtimeGlobalName</span><br><span class="line">  <span class="comment">// Generate const declaration for helpers</span></span><br><span class="line">  <span class="comment">// In prefix mode, we place the const declaration at top so it&#x27;s done</span></span><br><span class="line">  <span class="comment">// only once; But if we not prefixing, we place the declaration inside the</span></span><br><span class="line">  <span class="comment">// with block so it doesn&#x27;t incur the `in` check cost for every helper access.</span></span><br><span class="line">  <span class="keyword">const</span> helpers = <span class="title class_">Array</span>.<span class="title function_">from</span>(ast.<span class="property">helpers</span>)</span><br><span class="line">  <span class="keyword">if</span> (helpers.<span class="property">length</span> &gt; <span class="number">0</span>) &#123;</span><br><span class="line">    <span class="keyword">if</span> (!__BROWSER__ &amp;&amp; prefixIdentifiers) &#123;</span><br><span class="line">      <span class="title function_">push</span>(<span class="string">`const &#123; <span class="subst">$&#123;helpers.map(aliasHelper).join(<span class="string">&#x27;, &#x27;</span>)&#125;</span> &#125; = <span class="subst">$&#123;VueBinding&#125;</span>\n`</span>)</span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">      <span class="comment">// &quot;with&quot; mode.</span></span><br><span class="line">      <span class="comment">// save Vue in a separate variable to avoid collision</span></span><br><span class="line">      <span class="title function_">push</span>(<span class="string">`const _Vue = <span class="subst">$&#123;VueBinding&#125;</span>\n`</span>)</span><br><span class="line">      <span class="comment">// in &quot;with&quot; mode, helpers are declared inside the with block to avoid</span></span><br><span class="line">      <span class="comment">// has check cost, but hoists are lifted out of the function - we need</span></span><br><span class="line">      <span class="comment">// to provide the helper here.</span></span><br><span class="line">      <span class="keyword">if</span> (ast.<span class="property">hoists</span>.<span class="property">length</span>) &#123;</span><br><span class="line">        <span class="keyword">const</span> staticHelpers = [</span><br><span class="line">          <span class="variable constant_">CREATE_VNODE</span>,</span><br><span class="line">          <span class="variable constant_">CREATE_ELEMENT_VNODE</span>,</span><br><span class="line">          <span class="variable constant_">CREATE_COMMENT</span>,</span><br><span class="line">          <span class="variable constant_">CREATE_TEXT</span>,</span><br><span class="line">          <span class="variable constant_">CREATE_STATIC</span></span><br><span class="line">        ]</span><br><span class="line">          .<span class="title function_">filter</span>(<span class="function"><span class="params">helper</span> =&gt;</span> helpers.<span class="title function_">includes</span>(helper))</span><br><span class="line">          .<span class="title function_">map</span>(aliasHelper)</span><br><span class="line">          .<span class="title function_">join</span>(<span class="string">&#x27;, &#x27;</span>)</span><br><span class="line">        <span class="title function_">push</span>(<span class="string">`const &#123; <span class="subst">$&#123;staticHelpers&#125;</span> &#125; = _Vue\n`</span>)</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="comment">// generate variables for ssr helpers</span></span><br><span class="line">  <span class="keyword">if</span> (!__BROWSER__ &amp;&amp; ast.<span class="property">ssrHelpers</span> &amp;&amp; ast.<span class="property">ssrHelpers</span>.<span class="property">length</span>) &#123;</span><br><span class="line">    <span class="comment">// ssr guarantees prefixIdentifier: true</span></span><br><span class="line">    <span class="title function_">push</span>(</span><br><span class="line">      <span class="string">`const &#123; <span class="subst">$&#123;ast.ssrHelpers</span></span></span><br><span class="line"><span class="subst"><span class="string">        .map(aliasHelper)</span></span></span><br><span class="line"><span class="subst"><span class="string">        .join(<span class="string">&#x27;, &#x27;</span>)&#125;</span> &#125; = require(&quot;<span class="subst">$&#123;ssrRuntimeModuleName&#125;</span>&quot;)\n`</span></span><br><span class="line">    )</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="title function_">genHoists</span>(ast.<span class="property">hoists</span>, context)</span><br><span class="line">  <span class="title function_">newline</span>()</span><br><span class="line">  <span class="title function_">push</span>(<span class="string">`return `</span>)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></div>
<blockquote>
<p>“const _Vue &#x3D; Vue<br>const { createElementVNode: _createElementVNode, createTextVNode: _createTextVNode } &#x3D; _Vue<br>const _hoisted_1 &#x3D; { class: “todoapp” }<br>const _hoisted_2 &#x3D; { class: “header” }<br>const _hoisted_3 &#x3D; &#x2F;<em>#<strong>PURE</strong></em>&#x2F;_createElementVNode(“h1”, null, “todos”, -1 &#x2F;* HOISTED <em>&#x2F;)<br>const _hoisted_4 &#x3D; [“onUpdate:modelValue”, “onKeyup”]<br>const _hoisted_5 &#x3D; { class: “main” }<br>const _hoisted_6 &#x3D; [“onUpdate:modelValue”]<br>const _hoisted_7 &#x3D; &#x2F;</em>#<strong>PURE</strong><em>&#x2F;_createElementVNode(“label”, { for: “toggle-all” }, “Mark all as complete”, -1 &#x2F;</em> HOISTED *&#x2F;)<br>const _hoisted_8 &#x3D; { class: “todo-list” }<br>const _hoisted_9 &#x3D; { class: “view” }<br>const _hoisted_10 &#x3D; [“onUpdate:modelValue”]<br>const _hoisted_11 &#x3D; [“onDblclick”]<br>const _hoisted_12 &#x3D; [“onClick”]<br>const _hoisted_13 &#x3D; [“onUpdate:modelValue”, “onBlur”, “onKeyup”]<br>const _hoisted_14 &#x3D; { class: “footer” }<br>const _hoisted_15 &#x3D; { class: “todo-count” }<br>const _hoisted_16 &#x3D; { class: “filters” }<br>const _hoisted_17 &#x3D; [“onClick”]<br>return function render(_ctx, _cache) {“<br>但是这个时候，并没有完成翻译成code码，继续～</p>
</blockquote>
<p><code>generate</code> 方法中</p>
<div class="highlight-container" data-rel="Tsx"><figure class="iseeu highlight tsx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> functionName = ssr ? <span class="string">`ssrRender`</span> : <span class="string">`render`</span></span><br><span class="line"><span class="keyword">const</span> args = ssr ? [<span class="string">&#x27;_ctx&#x27;</span>, <span class="string">&#x27;_push&#x27;</span>, <span class="string">&#x27;_parent&#x27;</span>, <span class="string">&#x27;_attrs&#x27;</span>] : [<span class="string">&#x27;_ctx&#x27;</span>, <span class="string">&#x27;_cache&#x27;</span>]</span><br><span class="line"><span class="keyword">if</span> (!__BROWSER__ &amp;&amp; options.<span class="property">bindingMetadata</span> &amp;&amp; !options.<span class="property">inline</span>) &#123;</span><br><span class="line">  <span class="comment">// binding optimization args</span></span><br><span class="line">  args.<span class="title function_">push</span>(<span class="string">&#x27;$props&#x27;</span>, <span class="string">&#x27;$setup&#x27;</span>, <span class="string">&#x27;$data&#x27;</span>, <span class="string">&#x27;$options&#x27;</span>)</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">const</span> signature =</span><br><span class="line">  !__BROWSER__ &amp;&amp; options.<span class="property">isTS</span></span><br><span class="line">    ? args.<span class="title function_">map</span>(<span class="function"><span class="params">arg</span> =&gt;</span> <span class="string">`<span class="subst">$&#123;arg&#125;</span>: any`</span>).<span class="title function_">join</span>(<span class="string">&#x27;,&#x27;</span>)</span><br><span class="line">    : args.<span class="title function_">join</span>(<span class="string">&#x27;, &#x27;</span>)</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> (isSetupInlined) &#123;</span><br><span class="line">  <span class="title function_">push</span>(<span class="string">`(<span class="subst">$&#123;signature&#125;</span>) =&gt; &#123;`</span>)</span><br><span class="line">&#125; <span class="keyword">else</span> &#123;</span><br><span class="line">  <span class="title function_">push</span>(<span class="string">`function <span class="subst">$&#123;functionName&#125;</span>(<span class="subst">$&#123;signature&#125;</span>) &#123;`</span>)</span><br><span class="line">&#125;</span><br><span class="line"><span class="title function_">indent</span>()</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> (useWithBlock) &#123;</span><br><span class="line">  <span class="title function_">push</span>(<span class="string">`with (_ctx) &#123;`</span>)</span><br><span class="line">  <span class="title function_">indent</span>()</span><br><span class="line">  <span class="comment">// function mode const declarations should be inside with block</span></span><br><span class="line">  <span class="comment">// also they should be renamed to avoid collision with user properties</span></span><br><span class="line">  <span class="keyword">if</span> (hasHelpers) &#123;</span><br><span class="line">    <span class="title function_">push</span>(<span class="string">`const &#123; <span class="subst">$&#123;helpers.map(aliasHelper).join(<span class="string">&#x27;, &#x27;</span>)&#125;</span> &#125; = _Vue`</span>)</span><br><span class="line">    <span class="title function_">push</span>(<span class="string">`\n`</span>)</span><br><span class="line">    <span class="title function_">newline</span>()</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// generate asset resolution statements</span></span><br><span class="line"><span class="keyword">if</span> (ast.<span class="property">components</span>.<span class="property">length</span>) &#123;</span><br><span class="line">  <span class="title function_">genAssets</span>(ast.<span class="property">components</span>, <span class="string">&#x27;component&#x27;</span>, context)</span><br><span class="line">  <span class="keyword">if</span> (ast.<span class="property">directives</span>.<span class="property">length</span> || ast.<span class="property">temps</span> &gt; <span class="number">0</span>) &#123;</span><br><span class="line">    <span class="title function_">newline</span>()</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">if</span> (ast.<span class="property">directives</span>.<span class="property">length</span>) &#123;</span><br><span class="line">  <span class="title function_">genAssets</span>(ast.<span class="property">directives</span>, <span class="string">&#x27;directive&#x27;</span>, context)</span><br><span class="line">  <span class="keyword">if</span> (ast.<span class="property">temps</span> &gt; <span class="number">0</span>) &#123;</span><br><span class="line">    <span class="title function_">newline</span>()</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">if</span> (__COMPAT__ &amp;&amp; ast.<span class="property">filters</span> &amp;&amp; ast.<span class="property">filters</span>.<span class="property">length</span>) &#123;</span><br><span class="line">  <span class="title function_">newline</span>()</span><br><span class="line">  <span class="title function_">genAssets</span>(ast.<span class="property">filters</span>, <span class="string">&#x27;filter&#x27;</span>, context)</span><br><span class="line">  <span class="title function_">newline</span>()</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> (ast.<span class="property">temps</span> &gt; <span class="number">0</span>) &#123;</span><br><span class="line">  <span class="title function_">push</span>(<span class="string">`let `</span>)</span><br><span class="line">  <span class="keyword">for</span> (<span class="keyword">let</span> i = <span class="number">0</span>; i &lt; ast.<span class="property">temps</span>; i++) &#123;</span><br><span class="line">    <span class="title function_">push</span>(<span class="string">`<span class="subst">$&#123;i &gt; <span class="number">0</span> ? <span class="string">`, `</span> : <span class="string">``</span>&#125;</span>_temp<span class="subst">$&#123;i&#125;</span>`</span>)</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">if</span> (ast.<span class="property">components</span>.<span class="property">length</span> || ast.<span class="property">directives</span>.<span class="property">length</span> || ast.<span class="property">temps</span>) &#123;</span><br><span class="line">  <span class="title function_">push</span>(<span class="string">`\n`</span>)</span><br><span class="line">  <span class="title function_">newline</span>()</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// generate the VNode tree expression</span></span><br><span class="line"><span class="keyword">if</span> (!ssr) &#123;</span><br><span class="line">  <span class="title function_">push</span>(<span class="string">`return `</span>)</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">if</span> (ast.<span class="property">codegenNode</span>) &#123;</span><br><span class="line">  <span class="title function_">genNode</span>(ast.<span class="property">codegenNode</span>, context)</span><br><span class="line">&#125; <span class="keyword">else</span> &#123;</span><br><span class="line">  <span class="title function_">push</span>(<span class="string">`null`</span>)</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> (useWithBlock) &#123;</span><br><span class="line">  <span class="title function_">deindent</span>()</span><br><span class="line">  <span class="title function_">push</span>(<span class="string">`&#125;`</span>)</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="title function_">deindent</span>()</span><br><span class="line"><span class="title function_">push</span>(<span class="string">`&#125;`</span>)</span><br><span class="line"></span><br></pre></td></tr></table></figure></div>
<p>执行这部分代码后  code 加了下面部分字符串</p>
<blockquote>
<p>return function render(_ctx, _cache) {<br>  with (_ctx) {<br>    const { createElementVNode: _createElementVNode, vModelText: _vModelText, withKeys: _withKeys, withDirectives:<br>_withDirectives, vModelCheckbox: _vModelCheckbox, renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock,<br> createElementBlock: _createElementBlock, toDisplayString: _toDisplayString, resolveDirective: _resolveDirective,<br>normalizeClass: _normalizeClass, vShow: _vShow, createTextVNode: _createTextVNode } &#x3D; _Vue”</p>
</blockquote>
<h3 id="结果"><a href="#结果" class="headerlink" title="结果"></a>结果</h3><p><img  
                     lazyload
                     src="/images/loading.svg"
                     data-src="https://anca.gitee.io/jiesun.gitee.io/images/vue3-3/result.jpg"
                     
                ></p>
<blockquote>
<p>生成字符串方法后，在 vue 中 new Function(‘Vue’, code)(runtimeDom) createAppAPI 方法中，然后在<br>mount中调用</p>
</blockquote>

        </div>

        
            <div class="post-copyright-info">
                <div class="article-copyright-info-container">
    <ul>
        <li><strong>标题:</strong> vue3 源码分析（3）- 渲染函数</li>
        <li><strong>作者:</strong> jiesun</li>
        <li><strong>创建于
                :</strong> 2023-07-06 15:25:03</li>
        
            <li>
                <strong>更新于
                    :</strong> 2023-11-10 09:56:25
            </li>
        
        <li>
            <strong>链接:</strong> https://anca.gitee.io/jiesun.gitee.io/2023/07/06/vue3-3/
        </li>
        <li>
            <strong>
                版权声明:
            </strong>
            
            本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a> 进行许可。
            

        </li>
    </ul>
</div>

            </div>
        

        
            <ul class="post-tags-box">
                
                    <li class="tag-item">
                        <a href="/jiesun.gitee.io/tags/%E6%BA%90%E7%A0%81%E7%B3%BB%E5%88%97/">#源码系列</a>&nbsp;
                    </li>
                
            </ul>
        

        

        
            <div class="article-nav">
                
                    <div class="article-prev">
                        <a class="prev"
                        rel="prev"
                        href="/jiesun.gitee.io/2023/07/27/vue-api/"
                        >
                            <span class="left arrow-icon flex justify-center items-center">
                                <i class="fa-solid fa-chevron-left"></i>
                            </span>
                            <span class="title flex justify-center items-center">
                                <span class="post-nav-title-item">vue3 api浏览记录</span>
                                <span class="post-nav-item">上一篇</span>
                            </span>
                        </a>
                    </div>
                
                
                    <div class="article-next">
                        <a class="next"
                        rel="next"
                        href="/jiesun.gitee.io/2023/06/30/vue3-2/"
                        >
                            <span class="title flex justify-center items-center">
                                <span class="post-nav-title-item">vue3 源码分析（2）- 构造函数</span>
                                <span class="post-nav-item">下一篇</span>
                            </span>
                            <span class="right arrow-icon flex justify-center items-center">
                                <i class="fa-solid fa-chevron-right"></i>
                            </span>
                        </a>
                    </div>
                
            </div>
        


        
    </div>

    
        <div class="toc-content-container">
            <div class="post-toc-wrap">
    <div class="post-toc">
        <div class="toc-title">此页目录</div>
        <div class="page-title">vue3 源码分析（3）- 渲染函数</div>
        <ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%A4%A7%E8%87%B4%E8%BF%87%E7%A8%8B"><span class="nav-text">大致过程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#AST%EF%BC%88%E6%8A%BD%E8%B1%A1%E8%AF%AD%E6%B3%95%E6%A0%91%EF%BC%89"><span class="nav-text">AST（抽象语法树）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%9D%99%E6%80%81%E6%8F%90%E5%8D%87"><span class="nav-text">静态提升</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%BF%BB%E8%AF%91%E6%88%90%E6%B8%B2%E6%9F%93%E5%87%BD%E6%95%B0"><span class="nav-text">翻译成渲染函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%BB%93%E6%9E%9C"><span class="nav-text">结果</span></a></li></ol>

    </div>
</div>
        </div>
    
</div>



                

            </div>

            

        </div>

        <div class="main-content-footer">
            <footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
    <div class="info-container py-3 text-center">
        
        <div class="text-center">
            &copy;
            
              <span>2022</span>
              -
            
            2023&nbsp;&nbsp;<i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i>&nbsp;&nbsp;<a href="/">jiesun</a>
        </div>
        
            <script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
            <div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
                
                    <span id="busuanzi_container_site_uv" class="lg:!block">
                        <span class="text-sm">访问人数</span>
                        <span id="busuanzi_value_site_uv"></span>
                    </span>
                
                
                    <span id="busuanzi_container_site_pv" class="lg:!block">
                        <span class="text-sm">总访问量</span>
                        <span id="busuanzi_value_site_pv"></span>
                    </span>
                
            </div>
        
        <div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
            <span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
            <span class="text-sm lg:block">主题&nbsp;<a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.4.4</a></span>
        </div>
        
        
            <div>
                博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
            </div>
        
        
            <script data-swup-reload-script>
                try {
                    function odometer_init() {
                    const elements = document.querySelectorAll('.odometer');
                    elements.forEach(el => {
                        new Odometer({
                            el,
                            format: '( ddd).dd',
                            duration: 200
                        });
                    });
                    }
                    odometer_init();
                } catch (error) {}
            </script>
        
        
        
    </div>  
</footer>
        </div>
    </div>

    
        <div class="post-tools">
            <div class="post-tools-container">
    <ul class="article-tools-list">
        <!-- TOC aside toggle -->
        
            <li class="right-bottom-tools page-aside-toggle">
                <i class="fa-regular fa-outdent"></i>
            </li>
        

        <!-- go comment -->
        
    </ul>
</div>

        </div>
    

    <div class="right-side-tools-container">
        <div class="side-tools-container">
    <ul class="hidden-tools-list">
        <li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
            <i class="fa-regular fa-magnifying-glass-plus"></i>
        </li>

        <li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
            <i class="fa-regular fa-magnifying-glass-minus"></i>
        </li>

        <li class="right-bottom-tools tool-expand-width flex justify-center items-center">
            <i class="fa-regular fa-expand"></i>
        </li>

        <li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
            <i class="fa-regular fa-moon"></i>
        </li>

        <!-- rss -->
        

        

        <li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
            <i class="fa-regular fa-arrow-down"></i>
        </li>
    </ul>

    <ul class="visible-tools-list">
        <li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
            <i class="fa-regular fa-cog fa-spin"></i>
        </li>
        
            <li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
                <i class="arrow-up fas fa-arrow-up"></i>
                <span class="percent"></span>
            </li>
        
        
    </ul>
</div>

    </div>

    <div class="image-viewer-container">
    <img src="">
</div>


    

</main>


    
<script src="/jiesun.gitee.io/js/libs/Swup.min.js"></script>

<script src="/jiesun.gitee.io/js/libs/SwupSlideTheme.min.js"></script>

<script src="/jiesun.gitee.io/js/libs/SwupScriptsPlugin.min.js"></script>

<script src="/jiesun.gitee.io/js/libs/SwupProgressPlugin.min.js"></script>

<script src="/jiesun.gitee.io/js/libs/SwupScrollPlugin.min.js"></script>

<script>
    const swup = new Swup({
        plugins: [
            new SwupScriptsPlugin({
                optin: true,
            }),
            new SwupProgressPlugin(),
            new SwupScrollPlugin({
                offset: 80,
            }),
            new SwupSlideTheme({
                mainElement: ".main-content-body",
            }),
        ],
        containers: ["#swup"],
    });

    swup.hooks.on("page:view", () => {
        Global.refresh();
    });

    // if (document.readyState === "complete") {
    //
    // } else {
    //     document.addEventListener("DOMContentLoaded", () => init());
    // }
</script>






<script src="/jiesun.gitee.io/js/utils.js" type="module"></script>

<script src="/jiesun.gitee.io/js/main.js" type="module"></script>

<script src="/jiesun.gitee.io/js/layouts/navbarShrink.js" type="module"></script>

<script src="/jiesun.gitee.io/js/tools/scrollTopBottom.js" type="module"></script>

<script src="/jiesun.gitee.io/js/tools/lightDarkSwitch.js" type="module"></script>

<script src="/jiesun.gitee.io/js/layouts/categoryList.js" type="module"></script>





    
<script src="/jiesun.gitee.io/js/tools/codeBlock.js"></script>




    
<script src="/jiesun.gitee.io/js/layouts/lazyload.js"></script>




    
<script src="/jiesun.gitee.io/js/tools/runtime.js"></script>

    
<script src="/jiesun.gitee.io/js/libs/odometer.min.js"></script>

    
<link rel="stylesheet" href="/jiesun.gitee.io/assets/odometer-theme-minimal.css">




  
<script src="/jiesun.gitee.io/js/libs/Typed.min.js"></script>

  
<script src="/jiesun.gitee.io/js/plugins/typed.js"></script>







<div class="post-scripts" data-swup-reload-script>
    
        
<script src="/jiesun.gitee.io/js/libs/anime.min.js"></script>

        
<script src="/jiesun.gitee.io/js/tools/tocToggle.js" type="module"></script>

<script src="/jiesun.gitee.io/js/layouts/toc.js" type="module"></script>

<script src="/jiesun.gitee.io/js/plugins/tabs.js" type="module"></script>

    
</div>


    <div id="aplayer"></div>

<script src="/jiesun.gitee.io/js/libs/APlayer.min.js"></script>


<script src="/jiesun.gitee.io/js/plugins/aplayer.js"></script>


</body>
</html>
